﻿@@using Abp.Web.Mvc.Views
@@{
    ViewBag.Title = "@(Model.ConfigInfo.TableComment)";
    Layout = "~/Views/Shared/_LayoutBase.cshtml";
}

<div class="easyui-layout" style="width:100%;height:99%;">
    <div data-options="region:'west',split:true" title="@(Model.ConfigInfo.TableComment)管理" style="width:180px;">
        <ul id="leftTree"></ul>
    </div>
    <div id="mainCenter" data-options="region:'center',title:'',iconCls:'icon-ok'">
        <table id="datagrid" class="easyui-datagrid" toolbar="#toolbar1">
            <thead>
                <tr>
                    <th field="ck" checkbox="true"></th>
                    <th field="Id" hidden="true"></th>
                    <th field="Operate" width="60" align="center" formatter="formatOper">操 作</th>
                    @foreach(var col in Model.ColList)
                    {
                    <th field="@col.PropertyName" width="100" align="center">@col.CommentSimple</th>
                    }
                </tr>
            </thead>
        </table>
        <div id="toolbar1" class="easyui-panel datagrid-toolbar">
            <!--<a class="easyui-linkbutton" plain="true" onclick="@(Model.ConfigInfo.EntityName)Manage.import()"><i class="fa fa-file-excel-o fa-fw" aria-hidden="true"></i>导入</a>-->
            <a class="easyui-linkbutton" plain="true" onclick="@(Model.ConfigInfo.EntityName)Manage.addData()"><i class="fa fa-plus fa-fw" aria-hidden="true"></i>新增</a>
            <a class="easyui-linkbutton" plain="true" onclick="@(Model.ConfigInfo.EntityName)Manage.delData()"><i class="fa fa-trash-o fa-fw" aria-hidden="true"></i>删除</a>
            <a href="#" class="easyui-menubutton" data-options="menu:'#searchWrap',plain:true"><i class="fa fa-search fa-fw" aria-hidden="true"></i>筛选</a>
        </div>
        <div id="searchWrap" class="easyui-layout" style="width:360px;height:150px;filter:alpha(Opacity=30);background-color:#ffffff;">
            <form id="searchForm">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit-table">
                    <tbody>
                        @foreach(var col in Model.SearchList)
                        {
                        <tr>
                            <td class="rt_title">@(col.CommentSimple)：</td>
                            <td>
                                <input id="txt@(col.PropertyName)" name="@col.PropertyName" type="text" class="txt" />
                            </td>
                        </tr>
                        }
                        <tr>
                            <td align="center" colspan="2">
                                <a href="javascript:void(0)" class="easyui-linkbutton" onclick="@(Model.ConfigInfo.EntityName)Manage.getDataList()">确定</a>
                                <a href="javascript:void(0)" class="easyui-linkbutton" style="margin-left:15px;" onclick="@(Model.ConfigInfo.EntityName)Manage.resetSearch()">重置</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
</div>
<script>
	function formatState(value, row, index) {
		return value == "1" ? "可用" : "停用";
	}
    //绑定操作列
    function formatOper(value, row, index) {
        var ID = row.Id;
        var btnEditCss = "fa fa-pencil fa-fw";  //修改样式
        var styleEditDefault = "cursor:pointer;color:#3c8dbc;"; //默认修改颜色
        s = '<div class="operTbHeight">';
        if (getAuthorize('btnEdit', 1))
            s += '<a href="#" name="btnEdit" class="' + btnEditCss + '" style="' + styleEditDefault + '" title="编辑" onclick=@(Model.ConfigInfo.EntityName)Manage.editData("' + ID + '")></a>';
        s += '</div>';
        return s
    }
</script>